package gatech.cs3251.project4;

public enum MessageType {
	UPDATE (0),
	UPDATE_ACK (1),
	FRIENDS_REQ (2),
	FRIENDS_RESP (3),
	HISTORY_REQ (4),
	HISTORY_RESP (5),
	LEAVE (6);
	
	private final int type;
	
	public int type() {
		return type;
	}
	
	MessageType(int type) {
		this.type = type;
	}
	
	public static MessageType convert(int type) {
		for(MessageType m: values())
			if(m.ordinal() == type)
				return m;
		return null;
	}
}
